package com.example.module_mine.register.registernet

import com.example.module_mine.login.loginnet.MineApi
import com.example.module_mine.login.loginnet.MineNetMoudle
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject

class RegisterRePo @Inject constructor() {
    @Inject
    @MineNetMoudle.CommonMineApi
    lateinit var mineApi: MineApi

    fun register(username: String, password: String) =
        flow {
            emit(mineApi.register(username, password))
        }.flowOn(Dispatchers.IO)

    //我的
    fun getmine() =
        flow {
            emit(mineApi.getMine())
        }.flowOn(Dispatchers.IO)
}